/**
 *	全局变量文件
 *  @shapeColor 用于题型中几何图形的背景颜色样式
 *  @isIphoneX 是否为iphoneX系列
 *  @isIos 是否为Ios设备
 *  @imageScale 图片缩放大小
 *  @imageHeightScale 图片缩放高度
 *  @screenWidth 窗口宽度
 *  @screenHeight 窗口高度
 *  config 全局变量前缀 this.config.@param
 */
const shapeColor = {
	蓝: 'hue-rotate(0)',
	紫: 'hue-rotate(50deg)',
	橙: 'hue-rotate(160deg)',
	青: 'hue-rotate(290deg)',
	绿: 'hue-rotate(240deg)',
	黄: 'hue-rotate(150deg) saturate(1.2) contrast(5)',
	红: 'hue-rotate(135deg) saturate(5)',
	黑: 'brightness(0.1)',
	白: 'brightness(3) drop-shadow(0 0px 5px black)'
}
const res = uni.getSystemInfoSync();
const models = ['iPhone X', 'iPhone XS', 'iPhone XS Max', 'iPhone XR', 'iPhone 11', 'iPhone 11 Pro',
	'iPhone 11 Pro Max', 'iPhone 12', 'iPhone 12 Pro', 'iPhone 12 Pro Max'
]
const isIphoneList = models.filter(item => {
	return item === res.model.replace(/<.*/, '')
})
const isIphoneX = isIphoneList.length > 0
const isIos = res.platform === 'ios'
const imageScale = Math.ceil(res.screenWidth * res.pixelRatio / 3658 * 100)
const imageHeightScale = Math.ceil(res.screenWidth * res.pixelRatio / 1995 * 100)
const [screenWidth, screenHeight] = [res.screenWidth, res.screenHeight]
const config = {
	shapeColor,
	isIphoneX,
	isIos,
	imageScale,
	imageHeightScale,
	screenWidth,
	screenHeight
}
export default config
